const head=document.getElementsByTagName("HEAD")[0],link=document.createElement("link"),payUrl="https://atidium.io/pay/pay.php";function initAtdPay(){let t=document.getElementById("atdPay");t.innerHTML='
×

Atidium Pay

No forms. No fees. No delays.

';const e=document.getElementById("atdPayBtn"),a=document.getElementById("atdDetails"),n=document.getElementById("atdPayPop"),d=document.getElementById("atdPayPopClose"),i=document.getElementById("atdPaySend"),s=document.getElementById("atdPayToken"),o=document.getElementById("atdDots"),l=parseFloat(t.getAttribute("data-amount")).toFixed(4),r=t.getAttribute("data-account"),c=t.getAttribute("data-currency"),m=t.getAttribute("data-email");var y=0,p=null;function u(){var t="";y=++y%4;for(var e=0;e{n.classList.add("atd-pop-show")}),d.addEventListener("click",()=>{n.classList.remove("atd-pop-show")}),i.addEventListener("click",()=>{if(""!==s.value){p=setInterval(u,750),i.disabled=!0;let t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===this.readyState&&200===this.status)try{let t=JSON.parse(this.responseText);if(t.message.includes("Error")){let e=t.message.substring(t.message.indexOf("Error Details:"),t.message.indexOf("pending console output:"));alert(e),i.disabled=!1,clearInterval(p)}else alert("Thank you! The business owner will be notified about your payment.");n.classList.remove("atd-pop-show")}catch(t){alert("We have a problem understanding the response."),i.disabled=!1,clearInterval(p)}},t.open("POST",payUrl,!0),t.send(JSON.stringify({token:s.value.trim(),amount:l+" "+c,domain:window.location.hostname.replace("www.","").trim(),recipient:r.trim(),email:m.trim()}))}})}link.rel="stylesheet",link.type="text/css",link.href="https://dapp.atidium.io/static/pay/assets/style.css?v="+(new Date).getMilliseconds(),head.appendChild(link),window.attachEvent?window.attachEvent("onload",initAtdPay):window.onload=initAtdPay;